package com.yidu.ReportManagement.mapper;

import com.yidu.ReportManagement.entity.Bargin;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BarginMapper {
    @Select(" SELECT s.securityId,f.fundName,t.tradeNum,t.fees,e.transferFee,e.handlingFee,e.stampDuty,e.collectionFee,t.tradeMoney,t.tradeMoney-t.fees-e.stampDuty-e.transferFee-e.handlingFee-e.collectionFee\n" +
            " AS settleMoney FROM(SELECT * FROM trade)t JOIN (SELECT * FROM SECURITY)s ON t.securityId=s.securityId JOIN \n" +
            " (SELECT * FROM fund)f ON t.fundId=f.fundId JOIN(SELECT * FROM exchangerate)e ON s.exchangeName=e.exchangeName group by f.fundName")
    public List<Bargin> selectBargin();
}
